package demo1;

import java.lang.reflect.Array;
import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        Student student1 = new Student("小明",12);
        Student student2 = new Student("小李",11);
        Student student3 = new Student("小强",16);
        Student[] students = new Student[3];
        students[0] = student1;
        students[1] = student2;
        students[2] = student3;
        int ret = student1.compareTo(student2);
        if(ret > 0) {
            System.out.println(student1.name+">"+student2.name);
        } else if (ret < 0) {
            System.out.println(student1.name+"<"+student2.name);
        }else {
            System.out.println(student1.name+"="+student2.name);
        }
        Arrays.sort(students);
        System.out.println(Arrays.toString(students));
    }
}
